package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 询价报价操作类型枚举
 * @author 伍将
 * @date 2020/11/18
 * @version 2.0.0
 */
public enum InquiryQuotationOperateTypeEnum {

    /**
     * 待提交审核报价单
     */
    TO_BE_VALIFY_COMMIT(1, "待提交审核报价单", "/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer"),
    /**
     * 待审核报价单（一级）
     */
    TO_BE_VALIFY_STEP1(2, "待审核报价单（一级）", "/memberCenter/tranactionAbility/inquiryOffer/waitAuditOfferOne"),
    /**
     * 待审核报价单（二级）
     */
    TO_BE_VALIFY_STEP2(3, "待审核报价单（二级）", "/memberCenter/tranactionAbility/inquiryOffer/waitAuditOfferTwo"),
    /**
     * 待提交报价单
     */
    TO_BE_COMMIT(4, "待提交报价单", "/memberCenter/tranactionAbility/inquiryOffer/waitSubmitOffer");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    InquiryQuotationOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static InquiryQuotationOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(InquiryQuotationOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }
}
